import {
  DrivingLogListParams,
  DrivingLogListResponse,
  LogUploadTaskParams,
} from '@/types/intelligentDrivingLog/intelligentDrivingLogList.d';
import request from '@/utils/request';

// 获取品牌
export function getCurrentBrand() {
  return request('/common/vehicle/getcurrentbrand').then(res => res.data);
}

// 分页查询智驾日志管理
export function drivingLogList(params: DrivingLogListParams) {
  return request<DrivingLogListResponse>('/feedback/driving/log/page', { method: 'GET', params });
}

// 新建日志上传任务
export function createLogUploadTask(data: LogUploadTaskParams) {
  return request<{
    statusCode: string;
    statusMessage: string;
    data: any;
  }>('/feedback/driving/makeLog/upload', {
    method: 'POST',
    data,
  });
}

// 智驾日志管理页面点击续传
export function drivingLogContinuation(data: { id: string }) {
  return request<{
    statusCode: string;
    statusMessage: string;
    data: any;
  }>('/feedback/driving/log/continuation', {
    method: 'POST',
    data,
  });
}

// 智驾日志管理页面点击结束任务
export function drivingLogEndTask(data: { id: string }) {
  return request<{
    statusCode: string;
    statusMessage: string;
    data: any;
  }>('/feedback/driving/log/endTask', {
    method: 'POST',
    data,
  });
}
